/*
 * 
 * ControlComponent.java:
 * Handles drawing the robot controls
 */


import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridLayout;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JToggleButton;


public class ControlPanel extends JPanel{
	
	RobotPanel robot;
	
	JRadioButton addRobotToggle;
	JRadioButton addLightToggle;
	JButton startSim;
	JButton clearDraw;

    //Toggles
	boolean add_robot;
	boolean add_light;
	
	ButtonListener bl;
	

	public ControlPanel(RobotPanel rob){
		
		this.robot = rob;
		
		this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
		this.setBorder(BorderFactory.createLineBorder(Color.black));
		this.setSize(new Dimension(150,500));
		this.setPreferredSize(new Dimension(150,500));
		this.setVisible(true);
		
		add_robot = false;
		add_light = false;
		
		createButtons();
	}
	
	public void createButtons(){
		
	
		
	    addRobotToggle = new JRadioButton("Add Robot");
        addRobotToggle.setFont(new Font("sansserif",Font.PLAIN,20));
        this.add(addRobotToggle);
        
        addLightToggle = new JRadioButton("Add Light");
        addLightToggle.setFont(new Font("sansserif",Font.PLAIN,20));
        this.add(addLightToggle);
		
    	bl = new ButtonListener(robot,this);
        addRobotToggle.addActionListener(bl);
        addLightToggle.addActionListener(bl);
        
        startSim = new JButton("Start!");
        startSim.addActionListener(bl);
        this.add(startSim);
        
        clearDraw = new JButton("Clear");
        clearDraw.addActionListener(bl);
        this.add(clearDraw);
	}
}